package com.actions;
import javax.servlet.http.*;
import javax.swing.JOptionPane;

import java.util.*;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.beans.*;
import com.DAO.*;

public class DeleteCategoryAction  extends org.apache.struts.action.Action{

	private final static String SUCCESS = "success";
    
	public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
    	
    	CategoryDAO categoryDao=new CategoryDAO();
    	int id=Integer.parseInt(request.getParameter("id"));
    	int rowsAffected=categoryDao.delete(id);
    	
    		
    	
    	return mapping.findForward(SUCCESS);
		
	} 
}


